<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />

    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <p:dataTable id="companyCancel" value="#{cc.attrs.bill.bills}" var="b7"   sortBy="#{b7.billType}" rendered="#{cc.attrs.bill.bills.size()!=0}">
            <f:facet name="header">  
                <h:outputLabel value="Credit Company Payment Cancel"/>
            </f:facet> 
            <p:column headerText="Time" style="width:16%; " >
                <f:facet name="header">  
                    <h:outputLabel value="Time"/>
                </f:facet> 
                <h:outputLabel value="#{b7.createdAt}" >
                    <f:convertDateTime pattern="hh:mm a"/>
                </h:outputLabel>
            </p:column>

            <p:column headerText="Id" >
                <f:facet name="header">  
                    <h:outputLabel value="Id"/>
                </f:facet> 
                <h:outputLabel value="#{b7.insId}"/>
            </p:column>
            <p:column headerText="Credit Company"  >   
                <f:facet name="header">  
                    <h:outputLabel value="Credit Company"/>
                </f:facet> 
                <h:outputLabel value="#{b7.fromInstitution.name}" />
            </p:column>

            <p:column headerText="Cash" style="text-align: right;"   >
                <f:facet name="header">  
                    <h:outputLabel value="Cash"/>
                </f:facet> 
                <h:outputLabel rendered="#{b7.paymentMethod=='Cash'}" value="#{b7.netTotal}" >
                    <f:convertNumber pattern="#,##0.00"/>
                </h:outputLabel>
                <h:outputLabel rendered="#{b7.paymentMethod!='Cash'}" value="0.00"/>
            </p:column>   

            <p:column headerText="Cheque" style="text-align: right;"   >
                <f:facet name="header">  
                    <h:outputLabel value="Cheque"/>
                </f:facet> 
                <h:outputLabel rendered="#{b7.paymentMethod=='Cheque'}" value="#{b7.netTotal}" >
                    <f:convertNumber pattern="#,##0.00"/>
                </h:outputLabel>
                <h:outputLabel rendered="#{b7.paymentMethod!='Cheque'}" value="0.00"/>
            </p:column>    

            <p:column headerText="Slip" style="text-align: right;"   >
                <f:facet name="header">  
                    <h:outputLabel value="Slip"/>
                </f:facet> 
                <h:outputLabel rendered="#{b7.paymentMethod=='Slip'}" value="#{b7.netTotal}" >
                    <f:convertNumber pattern="#,##0.00"/>
                </h:outputLabel>
                <h:outputLabel rendered="#{b7.paymentMethod!='Slip'}" value="0.00"/>
            </p:column>    

            <p:column headerText="Descripion"  style="">
                <f:facet name="header">  
                    <h:outputLabel value="Descripion"/>
                </f:facet> 
                <h:outputLabel value="#{b7.comments}" />
            </p:column>    
            <p:column headerText="Billed Id" style="" >
                <f:facet name="header">  
                    <h:outputLabel value="Billed Id"/>
                </f:facet> 
                <h:outputLabel value="#{b7.billedBill.insId}" >
                </h:outputLabel>
            </p:column>
            <p:column headerText="Billed Date/Time" style="" >
                <f:facet name="header">  
                    <h:outputLabel value="Billed Date/Time"/>
                </f:facet> 
                <h:outputLabel value="#{b7.billedBill.createdAt}" >
                    <f:convertDateTime pattern="dd MM yy hh:mm a"/>
                </h:outputLabel>
            </p:column>
            <p:column>
                <p:selectBooleanCheckbox style="border: black 2px solid;"/>
            </p:column>
           
            <p:columnGroup type="footer">  
                <p:row>  
                    <p:column colspan="3" style="text-align:left" footerText="Totals:"/>  
                    <p:column footerText="#{cc.attrs.bill.cash}"/>                  
                    <p:column footerText="#{cc.attrs.bill.cheque}"/>   
                     <p:column footerText="#{cc.attrs.bill.slip}"/> 
                </p:row>  
            </p:columnGroup>
        </p:dataTable>
    </cc:implementation>
</html>